package main

import (
	"fmt"
	"math"
)

func main()  {
	/**测试获取时间
	formatTime := "2006-01-02 15:04:05"
	fmt.Println(time.Now().Format(formatTime))
	dateTime := "2020-07-06 16:20:00"
	parse, _ := time.Parse(formatTime, dateTime)
	fmt.Println(parse)
	*/

	/**sqlmap根据字段标签转换
	data := map[string]string{
		"id":"1",
		"product_name":"名字",
		"product_num":"100",
		"product_image":"www.baidu.com/image",
		"product_url":"www.baidu.com",
		"create_at": "2020-07-06 22:26:20",
		"update_at": "2020-07-06 22:30:20",
	}
	product := &datamodels.Product{}
	common.DataToStructByTagSql(data, product)
	*/

	/**读取ini文件
	cfg, err := common.NewIni()
	if err != nil {
		fmt.Println(err)
	}
	key, err := cfg.Section("mysql").GetKey("db.Name")
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(key)
	*/
	/**类型转换打印
	var v int64 = 2
	fmt.Sprintf("%s", v)
	var k int = 3
	fmt.Println(reflect.TypeOf(v))
	fmt.Println(reflect.TypeOf(k))
	*/
	/**空字符转换
	pageStr := string("")
	page, err := strconv.ParseInt(pageStr, 10, 64)
	if err != nil {
		fmt.Println(err)
	}
	println(page)
	*/
	a := float64(100) / float64(3)
	fmt.Println(a)
	b := math.Ceil(a)
	fmt.Println(b)

}
